package com.sunnyebuy.merchant.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import com.sunnyebuy.merchant.wrapper.I18nRequestWrapper;

/**
 * Created by Eclipse
 * Package: com.sunnyebuy.merchant.filter
 * Copyright : Copyright (c) 2008 - 2012 All rights reserved.
 * Created :  2012-1-31 下午8:33:47
 *
 * @author Wenzhong Gu
 * @version 1.0
 */
public class I18nFilter implements Filter {

	/* (non-Javadoc)
	 * @see javax.servlet.Filter#destroy()
	 */
	@Override
	public void destroy() {
		
	}

	/* (non-Javadoc)
	 * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
	 */
	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		HttpServletRequest r = (HttpServletRequest) request;  
        I18nRequestWrapper req = new I18nRequestWrapper(r);  
        chain.doFilter(req, response);  
		
	}

	/* (non-Javadoc)
	 * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
	 */
	@Override
	public void init(FilterConfig arg0) throws ServletException {
		
	}

}